--
-- Commands and menu to easyly edit players privs and stats
--

local modname = minetest.get_current_modname()
local modpath = minetest.get_modpath(modname)
local S = minetest.get_translator(modname)

--
-- global mod array
--
admin_ui = {}

dofile(modpath .. '/privs_levels.lua')
dofile(modpath .. '/privs_editor.lua')


--
-- Chatcommand : Find privs by keywords
--
minetest.register_chatcommand("privs_help", {
	params = "<keyword>",
	description = S("list and describe privs"),
	privs = {},
	func = function(name, param)
    local parami=""
    if param~=nil then
      parami=param
    end   
    for k, v in pairs(minetest.registered_privileges) do
      if string.find(k, parami) then
        minetest.chat_send_player(name,
          minetest.colorize("#2b74ff",k) .." : " .. v.description)
          print("'"..k.."',    -- " .. v.description)
      end
    end
  end
  })
